package com.zhen.Mapper;

import com.zhen.User.Student;
import com.zhen.User.Teacher;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TeacherMapper {
    @Select("select * from teacher")
    public List<Teacher> selectTeacher();
    @Select("select count(*) from teacher")
    public int countTeacher();

    @Select("select * from teacher limit #{begin},#{end}")
    public List<Teacher> selectTeacherpage(@Param("begin") Integer begin, @Param("end") Integer end);
    @Update("update teacher set name=#{name},sex=#{sex},classroom=#{classroom}," +
            "address=#{address},dianhua=#{dianhua},jianshao=#{jianshao},img=#{img}" +
            " where id=#{id}")
    public int updateTeacher(Teacher teacher);
    //添加老师
    @Insert("insert into teacher(name,sex,classroom,date,address,dianhua,jianshao,img,password)"+
            "values(#{name},#{sex},#{classroom},#{date},#{address},#{dianhua},#{jianshao},#{img},#{password})")
    public Integer jiaTeacher(Teacher teacher);
    //重置ls密码
    @Update("update teacher set password='123456' where id=#{id}" )
    public int updatePassword(@Param("id") Integer id);
    //查询
    List<Teacher> insertTeacher(@Param("id") Integer id,@Param("name") String name,@Param("sex") String sex,@Param("begin") Integer begin, @Param("end") Integer end);
    Integer countcha(@Param("id") Integer id,@Param("name") String name,@Param("sex") String sex);
    Integer delteacher(@Param("list") List<Integer> list);
}
